home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 141_01.zip / CLOCK.DOC < prev    next >
Text File  |  1993-06-01  |  2KB  |  55 lines

  1. clock.doc  84/04/06 pmk
  2.  
  3.     Inteface to Alpha Products NEWCLOCK-80 clock peripheral
  4.  
  5. The clock consists of 13 I/O ports addressed 0xB0 (176)
  6. to 0xBC (188) inclusive, each holding a four-bit right-
  7. justified integer. They represent seconds (0xB0), tens of 
  8. seconds (0xB1), minutes (0xB2), tens of minutes (0xB3), 
  9. hours (0xB4), tens of hours (0xB5), day of the week (0-6, 
  10. 0xB6), days (0xB7), tens of days (0xB8), months (0xB9), tens 
  11. of months (0xBA), years (0xBB), and tens of years (0xBC).
  12. Three of the ports also have special bits (within the right 
  13. nibble) as detailed below.  Each port can be both read and 
  14. written, but writing anything to either of the seconds digits 
  15. (0xB0, 0xB1) clears both of them.  All values read or written 
  16. should be AND'd with 0x0F.  
  17.  
  18.     The leap year, 12hr/24hr format, and AM/PM indication
  19. (for 12hr format only) are handled by special bits in the tens
  20. of days and tens of hours digits.  For leap year, bit 0x4 of 
  21. port 0xB8 is zero normally and one if the NEXT February has 29 
  22. days. (Omission of leap years on centuries not divisible by 
  23. 4 is probably not implemented - this will not matter until 
  24. 2100 AD!) Format and AM/PM are handled by bits in the tens of 
  25. hours digit: Bit 0x8 of port 0xB5 is zero for 12hr format and 
  26. one for 24hr format; bit 0x4 is zero for AM and one for PM 
  27. (but only if bit 0x8 is zero).  All these special bits must be 
  28. properly set when writing to their ports, or the modes will 
  29. change!  Other unnecessary high-order bits (0xE in tens of 
  30. months, 0x8 in day of week, tens of minutes and tens of 
  31. seconds) simply read as zeroes. 
  32.  
  33. Port    Dec    Contents
  34. 0xB0    176    Seconds - cleared by any write to 0xB0 or 0xB1
  35. 0xB1    177    Tens (3 bits) - cleared as above
  36. 0xB2    178    Minutes
  37. 0xB3    179      Tens (3 bits)
  38. 0xB4    180    Hours
  39. 0xB5    181      Tens (2 bits)
  40.         0x4: 0 = AM, 1 = PM (in 12hr format)
  41.         0x8: 0 = 12hr format, 1 = 24 hr format
  42. 0xB6    182    Day of Week (3 bits)
  43. 0xB7    183    Day of Month
  44. 0xB8    184      Tens (2 bits)
  45.         0x4: 0 = normal, 1 = 29 days next Feb
  46. 0xB9    185    Month
  47. 0xBA    186      Tens (1 bit)
  48. 0xBB    187    Year
  49. 0xBC    188      Tens
  50.  
  51. Clock is a utility to display the time and date. It continually
  52. reads the seconds digit of the clock and updates the display 
  53. whenever the last digit changes.
  54.  
  55. B5 is zero for 12hr format and